package com.kecheng.com.utils;

import com.kecheng.pojo.Team;
import org.apache.struts2.ServletActionContext;

import javax.servlet.http.HttpSession;

/**
 * 微信用户帮助类,用于微信用户相关
 */
public class WxUserHelpper {

    /**
     * 取得当前登录team
     *
     * @return
     */
    public static Team getTeam(){
        final HttpSession session = ServletActionContext.getRequest().getSession();
        Team team = (Team) session.getAttribute("user");
        return team;
    }

    public static String getOpenid(){
        final HttpSession session = ServletActionContext.getRequest().getSession();
        Team team = (Team) session.getAttribute("user");
        return team.getOpenid();
    }
}
